#include<bits/stdc++.h>
using namespace std;
typedef long long ll;

const int N = 85;

ll dp[N][N];
int g[N][N];
int n, m;

int main() {
    cin >> n >> m;

    for (int i = 1; i <= n; i ++ )
        for (int j = 1; j <= m; j ++ )
        {
            cin >> g[i][j];
        }

    for (int i = 1; i <= n; i ++ ) 
    {
        int l = 1, r = m;
    }
    return 0;
}